import request from '@/utils/request'
import { AxiosPromise } from 'axios'

enum Api {
  list = '/coupon/code/list',
  delete = '/coupon/code/remove',
  batchDelete = '/coupon/code/batchRemove',
}

// 获取列表
export const list = (data): AxiosPromise<any> => {
  return request({
    url: Api.list,
    method: 'post',
    data,
  })
}

// 删除
export const remove = (data: string) => {
  return request({
    url: Api.delete,
    method: 'post',
    data,
  })
}
// 批量删除
export const batchRemove = (data: (string | number)[]) => {
  return request({
    url: Api.batchDelete,
    method: 'post',
    data,
  })
}
